package com.csl.testjetpack.data.bean

import androidx.databinding.BaseObservable
import androidx.databinding.Bindable
import androidx.room.*

@Entity(
    tableName = "RemoteBtnInfo",
//    //关联外键
//    foreignKeys = [
//        ForeignKey(entity = RemoteInfo::class, parentColumns = ["id"], childColumns = ["remote_id"])
//    ],
//    //外键设置索引
//    indices = [Index("remote_id")]
)
data class RemoteButtonInfo(

    @Bindable
    var name: String,
    @Bindable
    var content: String

) : BaseObservable() {
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "id")
    var id: Long = 0


    @ColumnInfo(name = "remote_id")
    var remoteId: Long = 0


    override fun toString(): String {
        return "RemoteButtonInfo(name='$name', content='$content', id=$id, remoteId=$remoteId)"
    }


}